package com.hzncc.flowable_diboot.coderule.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.diboot.core.entity.BaseModel;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotNull;

/**
 * 编码规则 Entity 定义
 * @author MyName
 * @version 1.0
 * @date 2024-06-28
 * Copyright © MyCorp
 */

@TableName("mdl_code_rule")
@Getter @Setter @Accessors(chain = true)
public class CodeRule extends BaseModel {
    private static final long serialVersionUID = 1785183583285364141L;

    /**
     * 租户
     */
    @NotNull(message = "租户不能为空")
    @TableField()
    private String tenantId;

    /**
     * 编码
     */
    @Length(max=50, message="编码长度应小于50")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String code;

    /**
     * 名称
     */
    @Length(max=100, message="名称长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String name;

    /**
     * 前缀
     */
    @Length(max=50, message="前缀长度应小于50")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String prefix;

    /**
     * 分隔符1
     */
    @Length(max=5, message="分隔符1长度应小于5")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String separator1;

    /**
     * 年月日
     */
    @TableField()
    private String dateRule;

    /**
     * 分隔符2
     */
    @Length(max=5, message="分隔符2长度应小于5")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String separator2;

    /**
     * 流水号长度
     */
    @TableField()
    private Long sequenceLength;

    /**
     * 当前流水号
     */
    @TableField()
    private Integer currentNum;

    /**
     * 后缀
     */
    @Length(max=50, message="后缀长度应小于50")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String suffix;


}